package com.stx.jeepay.core.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.stx.jeepay.core.entity.PayOrderDivisionRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 分账记录表
 *
 * @author suntingxing
 * @email 1@gmail.com
 * @date 2023-09-11 13:05:22
 */
@Mapper
public interface PayOrderDivisionRecordDao extends BaseMapper<PayOrderDivisionRecordEntity> {

    /**
     * 查询全部分账成功金额
     **/
    Long sumSuccessDivisionAmount(@Param("payOrderId") String payOrderId);

    /**  batch_order_id 去重， 查询出所有的 分账已受理状态的订单， 支持分页。 */
    IPage<PayOrderDivisionRecordEntity> distinctBatchOrderIdList(Page page, @Param("ew") LambdaQueryWrapper<PayOrderDivisionRecordEntity> queryWrapper);
}
